package com.homer.iot.esptouch.model;

import com.homer.iot.esptouch.tcp.UartTCPUtil;

public class DoorContact extends Slaver {
	public DoorContact(String id, String type) {
		super(id, type);
	}

	public boolean getDoorContactStatus() {

		Byte ret = UartTCPUtil.getDoorContactStatus(device.getDeviceIP());
		if (null != ret) {
			//0：闭合；1：分离
			if (ret == 1) {
				return false;
			} else {
				return true;
			}
		}

		else
			return false;
	}
}
